//
//  UserHeaderTableViewCell.m
//  EasyChat
//
//  Created by 萱草~ on 16/6/14.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "UserHeaderTableViewCell.h"

@implementation UserHeaderTableViewCell

-(void)dealloc{
    [_headImage release];
    [_accountLabel release];
    [_nikeLabel release];
    [_IDLabel release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.headImage = [[UIImageView alloc] init];
        self.headImage.layer.cornerRadius = 5;
        self.headImage.clipsToBounds = YES;
        [self.contentView addSubview:self.headImage];
        [_headImage release];
        
        self.accountLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.accountLabel];
        [_accountLabel release];
        
        self.nikeLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.nikeLabel];
        [_nikeLabel release];
        
        self.IDLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.IDLabel];
        [_IDLabel release];
        
    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.headImage.frame = CGRectMake(10, 30, 60, 60);
    self.headImage.backgroundColor = [UIColor lightGrayColor];
    
    self.nikeLabel.frame = CGRectMake(10 + self.headImage.frame.size.width + 10, 30, VIEW_WIDTH - 20 - self.headImage.frame.size.width, self.headImage.frame.size.height / 2);
//    self.nikeLabel.backgroundColor = [UIColor lightGrayColor];
    
    self.accountLabel.frame = CGRectMake(10 + self.headImage.frame.size.width + 10, 35 + self.nikeLabel.frame.size.height , 25, self.headImage.frame.size.height / 2 - 10);
//    self.accountLabel.backgroundColor = [UIColor cyanColor];
    
    self.IDLabel.frame = CGRectMake(self.accountLabel.frame.origin.x + 25, self.accountLabel.frame.origin.y, VIEW_WIDTH - self.accountLabel.frame.origin.x - 30 , self.accountLabel.frame.size.height);
//    self.IDLabel.backgroundColor = [UIColor grayColor];
    
    
}

@end
